import requests


class IhrmDep(object):
    @classmethod
    def dep_add(cls,header,data):
        resp=requests.post(url="http://ihrm-test.itheima.net/api/company/department",
                           headers=header,
                           json=data)
        return resp

    @classmethod
    def dep_alter(cls, del_id,header, data):
        resp = requests.put(url="http://ihrm-test.itheima.net/api/company/department/"+del_id,
                             headers=header,
                             json=data)
        return resp

    @classmethod
    def dep_such(cls, del_id, header):
        resp = requests.get(url="http://ihrm-test.itheima.net/api/company/department/" + del_id,
                            headers=header
                            )
        return resp

    @classmethod
    def dep_remove(cls, del_id, header):
        resp = requests.delete(url="http://ihrm-test.itheima.net/api/company/department/" + del_id,
                            headers=header
                            )
        return resp
# if __name__ == '__main__':
#     del_id="1495311160612790272"
#     header={"Authorization": "7a46c628-78f5-4cd5-89bd-053e6b4bdd69"}
#     data1={"name": "阿莫"}
#     p=IhrmDep.dep_alter(del_id, header, data1)
#     print(p.json())


